package so.sao.code.service.infrastructure.enums;

import so.sao.top.core.util.enums.NamedEnumEntity;

public enum PrintFileSortDirection implements NamedEnumEntity<Integer> {
	Transverse(1, "横向排列"), Vertical(2, "竖向排列");

	private Integer id;
	private String name;

	private PrintFileSortDirection(Integer id, String name) {
		this.id = id;
		this.name = name;
	}

	@Override
	public Integer getValue() {
		return id;
	}

	@Override
	public String getName() {
		return name;
	}

	public static PrintFileSortDirection fromValue(Integer id) {
		switch (id) {
		case 1:
			return Transverse;
		case 2:
			return Vertical;
		default:
			throw new IllegalArgumentException("Value [" + id + "] not support!");
		}
	}
}
